-- @owner: zou_jialiang050
-- @date: 2024/4/2
-- @testpoint: 在非pipelined函数及存储过程中使用pipe row，合理报错

--step1:在非pipelined函数中使用pipe row;expect:合理报错
CREATE OR REPLACE FUNCTION func_pipelined_0021(num1 INTEGER, num2 INTEGER)
RETURNS INTEGER AS
$$
BEGIN
    pipe row(null);
    RETURN num1 + num2;
END;
$$
 LANGUAGE plpgsql;
/

--step2:在存储过程中使用pipe row;expect:合理报错
create procedure proc_pipelined_0021(p_value INTEGER)
as
begin
    pipe row(null);
    RAISE NOTICE 'The value passed is: %', p_value;
end;
/
